﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Movies.Web.Models;
using System.ComponentModel.DataAnnotations;

namespace Movies.Web
{
    public class Movie
    {
        public Movie()
        {
            this.Actors = new HashSet<Actor>();
           
        }

     

        public int Id { get;  set; }
        [Required(AllowEmptyStrings=false, ErrorMessage="You must supply a movie name")]
        public string Name { get; set; }

        [Required(ErrorMessage="You must supply a release date")]
        [DataType(DataType.Date, ErrorMessage="Must be in date format like so Febuary 8, 2011")]
        public DateTime? RelaseDate { get; set; }

        [UIHint("Rating")]
        public string Rating { get; set; }
        public virtual Director DirectedBy { get; set; }
        [UIHint("Actors")]
        public virtual ICollection<Actor> Actors { get; set; }

    }
}